import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

class TextPage extends StatelessWidget {
  const TextPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text(
          '我是文本我是文本我是文本我是文本我是文本我是文本我是文本我是文本我是文本我是文本我是文本我是文本我是文本',
          textScaler: TextScaler.linear(1.5),
          style: TextStyle(
            fontSize: 24,
            color: Colors.amber,
            fontWeight: FontWeight.bold,
            decoration: TextDecoration.underline,
          ),
          // 溢出
          maxLines: 3,
          softWrap: true,
          overflow: TextOverflow.ellipsis,
        ),
        Text.rich(
          TextSpan(
            text: 'aaaaaaaaaaaa',
            children: [
              TextSpan(
                text: 'bbbbbbbbbbbb',
                style: TextStyle(
                  color: Colors.green,
                  fontSize: 42,
                  fontWeight: FontWeight.bold,
                ),
                recognizer: TapGestureRecognizer()
                  ..onTap = () {
                    debugPrint('点击了');
                  },
              ),
              TextSpan(
                text: 'ccccccc',
                style: TextStyle(
                  color: Colors.blue,
                  fontSize: 22,
                  fontWeight: FontWeight.bold,
                ),
              ),
              TextSpan(
                text: 'dddddddddd',
                style: TextStyle(
                  color: Colors.yellow,
                  fontSize: 50,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ],
          ),
        ),
      ],
    );
  }
}
